﻿/*
 * Copyright (c) 2020-2025, Qingdao Digital Intelligent Ship & Ocean Technology Co., Ltd.
 * All rights reserved.
 *
 * This file is part of FastCAE and is distributed under the terms of the
 * BSD 3-Clause License. See the LICENSE file in the project root for details.
 */

#include "FITKGeoToMeshMapper.h"

namespace Interface
{
    FITKGeoToMeshMapper::FITKGeoToMeshMapper()
    {

    }

    FITKGeoToMeshMapper::~FITKGeoToMeshMapper()
    {

    }

    void FITKGeoToMeshMapper::clear()
    {
        _meshVerOfGeoNode.clear();
        _meshEleOfGeoEdge.clear();
        _meshEleOfGeoFace.clear();
        _meshEleOfGeoSolid.clear();
    }

    void FITKGeoToMeshMapper::insertMeshVertexOfGeoNode(int geoNodeID, int meshVertexID)
    {
        _meshVerOfGeoNode.insert(geoNodeID, meshVertexID);
    }

    void FITKGeoToMeshMapper::removeMeshVertexOfGeoNode(int geoNodeID)
    {
        _meshVerOfGeoNode.remove(geoNodeID);
    }

    QHash<int, int> FITKGeoToMeshMapper::getMeshVertexOfGeoNode()
    {
        return _meshVerOfGeoNode;
    }

    void FITKGeoToMeshMapper::insertMeshEleOfGeoFace(int faceID, int eleID, int faceIndex)
    {
        _meshEleOfGeoFace[faceID].insert(eleID, faceIndex);
    }

    void FITKGeoToMeshMapper::removeMeshEleOfGeoFace(int faceID)
    {
        _meshEleOfGeoFace.remove(faceID);
    }

    QHash<int, QHash<int, int>> FITKGeoToMeshMapper::getMeshEleOfGeoFace()
    {
        return _meshEleOfGeoFace;
    }

    void FITKGeoToMeshMapper::insertMeshEleOfGeoEdge(int edgeID, int eleID, int edgeIndex)
    {
        _meshEleOfGeoEdge[edgeID].insert(eleID, edgeIndex);
    }

    void FITKGeoToMeshMapper::removeMeshEleOfGeoEdge(int edgeID)
    {
        _meshEleOfGeoEdge.remove(edgeID);
    }

    QHash<int, QHash<int, int>> FITKGeoToMeshMapper::getMeshEleOfGeoEdge()
    {
        return _meshEleOfGeoEdge;
    }

    void FITKGeoToMeshMapper::insertMapOfGeoSolid(int solidID, int meshEleID)
    {
        _meshEleOfGeoSolid[solidID].append(meshEleID);
    }

    void FITKGeoToMeshMapper::removeMapOfGeoSolid(int solidID)
    {
        _meshEleOfGeoSolid.remove(solidID);
    }

    QHash<int, QList<int>> FITKGeoToMeshMapper::getMeshEleOfGeoSolid()
    {
        return _meshEleOfGeoSolid;
    }
}
